<?php
$TaskId = $_GET['TaskId'] ?? '';

$dsn = "sqlsrv:Server=localhost;Database=Task";
$db = new PDO($dsn, "sa", "123456");
$sql = "update Task set TaskStatus=3 where TaskId='{$TaskId}';";
$result = $db->exec($sql);

if ($result) {
    echo "标记成功！<a href='task_list.php'>点击返回列表</a>";
} else {
    echo "标记失败";
}